package pencil.controller;


import java.util.Date;
import java.util.Timer;
import java.util.TimerTask;

public class tests {

	public static void main(String[] args) {
	      ScheduledJob job = new ScheduledJob();
	      Timer jobScheduler = new Timer();
	      jobScheduler.scheduleAtFixedRate(job, 1000, 1000);
	      try {
	         Thread.sleep(20000);
	      } catch(InterruptedException ex) {
	         //
	      }
	      jobScheduler.cancel();
	   }
	}

	class ScheduledJob extends TimerTask {
	   
	   public void run() {
	      System.out.println(new Date());
	   }
	}